package Review.Thread;

public class Demo3 {
    /**
     * 使用匿名内部类数显Runnable
     * @param args
     * @throws InterruptedException
     */
    public static void main(String[] args) throws InterruptedException {
        Runnable runnable = new Runnable(){
            @Override
            public void run() {
               while (true){
                   while (true){
                       System.out.println("小野猫想要抱着我");
                       try {
                           Thread.sleep(1000);
                       } catch (InterruptedException e) {
                           throw new RuntimeException(e);
                       }
                   }
               }
            }
        };
        Thread t1 = new Thread(runnable);
        t1.start();
        while (true){
            System.out.println("我抱着小野猫疯狂的亲");
            Thread.sleep(1000);
        }
    }
}
